<?php
namespace Core;

if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
** etc:  初始模型层
** author: deepe.xiao
** update: 2018-10-10
*/

class Model{
	static $_instance = array();
	protected  $db ;

	var $get;    
	var $post;  

	function __construct($DB = true){
		//默认加载数据库
		if ($DB){
			include_once( BASEPATH."deepe.MyPDO.php" );
			$this->db = MyPDO::getInstance();
		}
	}


	function loadClass( $class ){
		include_once( BASEPATH.$class.".php" );
		$className = ucfirst($class);
//		$this->$className = new $className();
		$this->$className = $_instance[$class] = new static();
	}
}
?>
